home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / PictUtils.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.9 KB  |  173 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT PictUtils;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PICTUTILS__}
  27. {$SETC __PICTUTILS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC PictUtilsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __WINDOWS__}
  40. {$I Windows.p}
  41. {$ENDC}
  42. {    Memory.p                                                    }
  43. {        MixedMode.p                                                }
  44. {    Quickdraw.p                                                    }
  45. {        QuickdrawText.p                                            }
  46. {    Events.p                                                    }
  47. {        OSUtils.p                                                }
  48. {    Controls.p                                                    }
  49. {        Menus.p                                                    }
  50.  
  51. {$IFC UNDEFINED __PALETTES__}
  52. {$I Palettes.p}
  53. {$ENDC}
  54.  
  55. {$PUSH}
  56. {$ALIGN MAC68K}
  57. {$LibExport+}
  58.  
  59. CONST
  60.     returnColorTable            = $0001;
  61.     returnPalette                = $0002;
  62.     recordComments                = $0004;
  63.     recordFontInfo                = $0008;
  64.     suppressBlackAndWhite        = $0010;
  65.  
  66. { color pick methods }
  67.     systemMethod                = 0;                            { system color pick method }
  68.     popularMethod                = 1;                            { method that chooses the most popular set of colors }
  69.     medianMethod                = 2;                            { method that chooses a good average mix of colors }
  70. { color bank types }
  71.     ColorBankIsCustom            = -1;
  72.     ColorBankIsExactAnd555        = 0;
  73.     ColorBankIs555                = 1;
  74.  
  75.     
  76. TYPE
  77.     PictInfoID = LONGINT;
  78.  
  79.     CommentSpec = RECORD
  80.         count:                    INTEGER;                                { number of occurrances of this comment ID }
  81.         ID:                        INTEGER;                                { ID for the comment in the picture }
  82.     END;
  83.     CommentSpecPtr = ^CommentSpec;
  84.     CommentSpecHandle = ^CommentSpecPtr;
  85.  
  86.     FontSpec = RECORD
  87.         pictFontID:                INTEGER;                                { ID of the font in the picture }
  88.         sysFontID:                INTEGER;                                { ID of the same font in the current system file }
  89.         size:                    ARRAY [0..3] OF LONGINT;                { bit array of all the sizes found (1..127) (bit 0 means > 127) }
  90.         style:                    INTEGER;                                { combined style of all occurrances of the font }
  91.         nameOffset:                LONGINT;                                { offset into the fontNamesHdl handle for the font’s name }
  92.     END;
  93.     FontSpecPtr = ^FontSpec;
  94.     FontSpecHandle = ^FontSpecPtr;
  95.  
  96.     PictInfo = RECORD
  97.         version:                INTEGER;                                { this is always zero, for now }
  98.         uniqueColors:            LONGINT;                                { the number of actual colors in the picture(s)/pixmap(s) }
  99.         thePalette:                PaletteHandle;                            { handle to the palette information }
  100.         theColorTable:            CTabHandle;                                { handle to the color table }
  101.         hRes:                    Fixed;                                    { maximum horizontal resolution for all the pixmaps }
  102.         vRes:                    Fixed;                                    { maximum vertical resolution for all the pixmaps }
  103.         depth:                    INTEGER;                                { maximum depth for all the pixmaps (in the picture) }
  104.         sourceRect:                Rect;                                    { the picture frame rectangle (this contains the entire picture) }
  105.         textCount:                LONGINT;                                { total number of text strings in the picture }
  106.         lineCount:                LONGINT;                                { total number of lines in the picture }
  107.         rectCount:                LONGINT;                                { total number of rectangles in the picture }
  108.         rRectCount:                LONGINT;                                { total number of round rectangles in the picture }
  109.         ovalCount:                LONGINT;                                { total number of ovals in the picture }
  110.         arcCount:                LONGINT;                                { total number of arcs in the picture }
  111.         polyCount:                LONGINT;                                { total number of polygons in the picture }
  112.         regionCount:            LONGINT;                                { total number of regions in the picture }
  113.         bitMapCount:            LONGINT;                                { total number of bitmaps in the picture }
  114.         pixMapCount:            LONGINT;                                { total number of pixmaps in the picture }
  115.         commentCount:            LONGINT;                                { total number of comments in the picture }
  116.         uniqueComments:            LONGINT;                                { the number of unique comments in the picture }
  117.         commentHandle:            CommentSpecHandle;                        { handle to all the comment information }
  118.         uniqueFonts:            LONGINT;                                { the number of unique fonts in the picture }
  119.         fontHandle:                FontSpecHandle;                            { handle to the FontSpec information }
  120.         fontNamesHandle:        Handle;                                    { handle to the font names }
  121.         reserved1:                LONGINT;
  122.         reserved2:                LONGINT;
  123.     END;
  124.     PictInfoPtr = ^PictInfo;
  125.     PictInfoHandle = ^PictInfoPtr;
  126.  
  127.  
  128. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  129.     {$IFC NOT GENERATINGCFM}
  130.     INLINE $303C, $0800, $A831;
  131.     {$ENDC}
  132. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  133.     {$IFC NOT GENERATINGCFM}
  134.     INLINE $303C, $0801, $A831;
  135.     {$ENDC}
  136. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  137.     {$IFC NOT GENERATINGCFM}
  138.     INLINE $303C, $0602, $A831;
  139.     {$ENDC}
  140. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  141.     {$IFC NOT GENERATINGCFM}
  142.     INLINE $303C, $0403, $A831;
  143.     {$ENDC}
  144. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  145.     {$IFC NOT GENERATINGCFM}
  146.     INLINE $303C, $0404, $A831;
  147.     {$ENDC}
  148. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  149.     {$IFC NOT GENERATINGCFM}
  150.     INLINE $303C, $0505, $A831;
  151.     {$ENDC}
  152. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  153.     {$IFC NOT GENERATINGCFM}
  154.     INLINE $303C, $0206, $A831;
  155.     {$ENDC}
  156. {$IFC OLDROUTINENAMES }
  157. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  158.     {$IFC NOT GENERATINGCFM}
  159.     INLINE $303C, $0206, $A831;
  160.     {$ENDC}
  161. {$ENDC}
  162.  
  163. {$ALIGN RESET}
  164. {$POP}
  165.  
  166. {$SETC UsingIncludes := PictUtilsIncludes}
  167.  
  168. {$ENDC} {__PICTUTILS__}
  169.  
  170. {$IFC NOT UsingIncludes}
  171.  END.
  172. {$ENDC}
  173.